<!--
 * @Description: 
 * @Author: Ronda
 * @Date: 2021-08-10 13:23:06
 * @LastEditors: 何梦龙
 * @LastEditTime: 2022-05-16 20:23:41
-->

<template>
<div>
  <!-- 头部 -->
    <van-nav-bar
      title="常用地址"
      left-text="返回"
      left-arrow
      @click-left="$router.back()"
    />

  <!-- 地址信息展示 -->
    <van-address-list
  v-model="chosenAddressId" 
  :list="list"
  @add="onAdd"
  @edit="onEdit"
   @click-onAdd="$router.back('onEdit')"

 
/>


 <!-- 增加地址 -->
 <van-address-edit
  :area-list="areaList"
  show-search-result
  :search-result="searchResult"
  :area-columns-placeholder="['请选择', '请选择', '请选择']"
  @submit="onSubmit"
   
/>
  
</div>
</template>

 

<script>
 import { Toast } from 'vant';
 import { areaList } from '@vant/area-data';
export default {
  data() {
    return {
      areaList ,
      chosenAddressId: '1',
      list: [
        {
          id: '2300',
          name: '詹姆斯',
          tel: '11111112222',
          address: '上海市上海市静安区静安区',
          isDefault: true,
        },
        {
          id: '2299',
          name: '张尔尔',
          tel: '19000000000',
          address: '内蒙古自治区赤峰市元宝山区购物广场',
          isDefault: true,
        },
        {
          id: '2298',
          name: '张二二',
          tel: '13000000000',
          address: '江苏省苏州市昆山市巴城镇浦东软件园',
          isDefault: true,
        },
        {
          id: '2297',
          name: '张三',
          tel: '11111111111',
          address: '江苏苏州昆山巴城镇学院路浦东软件园',
          isDefault: true,
        },
        {
          id: '2296',
          name: '马宏宇',
          tel: '18896827921',
          address: '山西省临汾市侯马市幸福里2栋201',
          isDefault: true,
        },
        {
          id: '2295',
          name: '高大山',
          tel: '17898766678',
          address: '山西省运城市闻喜县公园壹号3期2单元901',
          isDefault: true,
        },
      ],
    };
  },
  computed: {},
  methods: { 
    
    onAdd() {
      Toast('新增地址');
    },
    onEdit(item, index) {
      Toast('编辑地址:' + index);
    },
  },
  created() {},
  mounted() {}
};
</script>
<style scoped>
 .van-popup {
  color: blueviolet;
   background-image: linear-gradient(to right, #7579ff, #bf73ff);
  max-width: 10px;
  height: 20px;
}
 
</style>